/*
 * @Author: 贺楚 2402041262@qq.com
 * @Date: 2023-01-11 17:35:48
 * @LastEditors: 贺楚 2402041262@qq.com
 * @LastEditTime: 2023-01-13 15:56:06
 * @FilePath: \vue-admin-template-master\src\utils\validate.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/**
 * Created by PanJiaChen on 16/11/18.
 */

/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
}

/**
 * @param {string} str
 * @returns {Boolean}
 */
export function validUsername(str) {
  const valid_map = ['admin', 'editor', 'wyx']
  return valid_map.indexOf(str.trim()) >= 0
}
